/**
 * 直接返回 window 下的定义变量
 * @date 2020-08-18
 */
(function () {
  //创建一个iframe来辨别window下的原始元素
  var el = document.createElement("iframe");
  el.style.display = "none";
  document.body.appendChild(el);
  var iframe = el.contentWindow;
  el.remove();
  //比较两个对象差异
  let diff = Object.entries(window).filter((prop) => !(prop[0] in iframe));
  return Object.fromEntries(diff);
})();
